#pragma once
#include "common.h"

class CSender
{
private:
	static CSender* m_Instance;

	CSender(void);
	virtual ~CSender(void);

	map<jint, JNIEnv*> m_mEnv;
	map<jint, jobject> m_mRoom;
	map<jint, jmethodID> m_mEndgameid;
	map<jint, jmethodID> m_mMid;
	map<jint, jmethodID> m_mTurnOverid;
	map<jint, int*> m_mUserID;

public:
	static CSender* getInstance(void);
	static void createInstance(void);
	static void destroy(void);

	void initialize(void);
	void initializeRoom(jint roomId);
	void renew(JNIEnv* env, jobject room, jint roomId);
	void setUserID(jint roomId, int userSlot, int userID);
	void setPacket(EVENTTYPE eventtype, vector<int> vChplist, int userSlot, jint roomId);
	void sendMessage(string str, jint roomId);

	void destroyRoom(jint roomId);

	void sendTurnover(int userSlot, jint roomId);
	void sendGameover(jint roomId);
	void printSomething(void);
};

